package main

import (
	"net/http"
	"fmt"
)

type String string

func (s String) ServeHTTP(w http.ResponseWriter,r  *http.Request) {
	fmt.Fprintf(w,string(s))
}



type Struct struct {
	Greeting string
	Punct string
	Who string
}

func (s Struct) ServeHTTP(w http.ResponseWriter,r *http.Request) {
	fmt.Fprintf(w,fmt.Sprintf("%v", s))
}

func main() {
	http.Handle("/string",String("我是黄柳淞"))
	http.Handle("/struct",&Struct{"huangliusong",":","hello!"})



	e:=http.ListenAndServe(":8888",nil)

	if e!=nil{
		fmt.Printf("%s",e)
	}

}
